<!--<template>-->
<!--  <el-input-->
<!--    v-model="val"-->
<!--    :type="type"-->
<!--    :size="preferences.FormSize"-->
<!--    :clearable="clearable"-->
<!--    :showPassword="showPassword"-->
<!--    :disabled="disabled"-->
<!--    v-bind="$attrs"-->
<!--    v-on="$listeners"-->
<!--    @change="change"-->
<!--  >-->
<!--    <template slot="prefix" v-if="$slots['prefix']">-->
<!--      <slot name="prefix"></slot>-->
<!--    </template>-->
<!--    <template slot="suffix" v-if="$slots['suffix']">-->
<!--      <slot name="suffix"></slot>-->
<!--    </template>-->
<!--    <template slot="prepend" v-if="$slots['prepend']">-->
<!--      <slot name="prepend"></slot>-->
<!--    </template>-->
<!--    <template slot="append" v-if="$slots['append']">-->
<!--      <slot name="append"></slot>-->
<!--    </template>-->
<!--  </el-input>-->
<!--</template>-->

<script>
import ElInput from 'element-ui/packages/input/src/input'
export default {
  name: "MInput",
  data() {
    return {
      val: null
    }
  },
  extends:ElInput,
  model: {
    prop: 'value'
  },
  components: {},
  props:{
    type: {
      type: String,
      default: 'text'
    },
    value: {
      type: [String, Number]
    },
    clearable:{
      type: Boolean,
      default: true
    },
    disabled: {
      type: Boolean,
      default: false
    },
    size:{
      type: String,
      default: 'small'
    }
  },
  watch: {
    value:{
      handler: function (e){
        this.val = e
        // this.$emit('input', e + '123')
      },
      immediate: true,
    }
  },
  mounted() {
  },
  methods: {
    handleChange(event) {
      let value = event.target.value.trim()
      this.$emit('input', value);
      this.$emit('change', value);
    },
  }
}
</script>

<style lang="scss" scoped>
@import "../../style/var.scss";
</style>
